// 云函数入口文件
const cloud = require('wx-server-sdk');
const request = require('request');
const access_token = require('AccessToken');

cloud.init({
  env: cloud.DYNAMIC_CURRENT_ENV,
  throwOnNotFound: false
})

let appid = 'wx0b1a669b0b7a2f93';//微信公众号开发者id
let secret = '21585b7b3c805a1abb62f69b7ad199fa';//微信公众号开发者secret_key

// 云函数入口函数
exports.main = async (event, context) => {
  let at = new access_token({
    appid,
    secret
  });
  
  return at.getCachedWechatAccessToken();
}